package com.fsy.weibao.workorder.domain;

import cc.mrbird.febs.common.converter.TimeConverter;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wuwenze.poi.annotation.Excel;
import com.wuwenze.poi.annotation.ExcelField;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

@Data
@TableName("wb_work_order")
@Excel("任务工单表")
public class WorkOrder  implements Serializable {

    public static final int TYPE_FIRE = 0;
    public static final int TYPE_FAULT = 1;
    public static final int TYPE_REPAIR = 2;
    public static final int TYPE_INSPECT = 3;
    public static final int TYPE_MAINTAIN = 4;

    public static final int STATUS_DISTRIBUTE = 0;
    public static final int STATUS_GRAB = 1;
    public static final int STATUS_PRE_HANDLE = 2;
    public static final int STATUS_HANDLING = 3;
    public static final int STATUS_APPROVAL = 4;
    public static final int STATUS_COMPLETE = 5;

    @TableId(type = IdType.AUTO)
    private Long id;

    private String processId;

    @NotNull(message = "{required}")
    private Integer type;

    private Integer status;

    private Long createUser;

    private transient String createUserName;

    private Long curUser;

    private transient String curUserName;

    //任务审核人
    private Long acceptUser;

    @NotBlank(message = "{required}")
    @Size(max = 128, message = "{noMoreThan}")
    private String project;

    @ExcelField(value = "创建时间", writeConverter = TimeConverter.class)
    private Date createTime;

    @ExcelField(value = "完成时间", writeConverter = TimeConverter.class)
    private Date completeTime;

    @NotBlank(message = "{required}")
    @Size(max = 128, message = "{noMoreThan}")
    private String name;

    //派单方式，0-指派，1-众包
    private transient Integer distributeType;
    //任务处理人
    private transient Long handleUser;
    //任务处理方式
    private transient String treatment;
    //审核是否通过
    private transient Boolean accept;
    //备注
    private transient String remark;
}
